package hostcompetition;
import java.util.Arrays;
import java.util.Scanner;
public class HostCompetition1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("输入评委人数: ");

        double[] scores = new double[scan.nextInt()];
        System.out.println("输入评分:");

        for (int i = 0; i < scores.length; i++) {
            scores[i] = scan.nextDouble();
        }

        Arrays.sort(scores);
        double sum = 0;
        for (int i = 1; i < scores.length - 1; i++) {
            sum += scores[i];
        }

        System.out.printf("最终得分: %.2f", sum / (scores.length - 2));
    }
}
